<template>
  <div class="home">
    <div class="main">
      <div class="search">
        <span>杭州</span>
        <img
          class="arrow-down"
          src="https://kpan.oss-cn-hangzhou.aliyuncs.com/mini_program/search-arrow-down.png"
          alt=""
        />
        <span class="line">|</span>
        <img
          class="search-icon"
          src="https://kpan.oss-cn-hangzhou.aliyuncs.com/mini_program/search.png"
          alt=""
        />
        <input type="text" placeholder="搜索楼盘" />
      </div>
      <div class="nav">
        <div class="menus">
          <div
            class="menus-item"
            v-for="(item, index) in menuInfo"
            :key="index"
          >
            <div class="box">{{ item.size }}</div>
            <div class="title">{{ item.title }}</div>
          </div>
        </div>
        <div class="menus">
          <div class="menus-item" v-for="(item, index) in menuBar" :key="index">
            <div class="icon"><img :src="item.icon" alt="" /></div>
            <div class="title">{{ item.title }}</div>
          </div>
        </div>
        <div class="adv">
          <span
            ><img
              class="article-icon"
              src="https://kpan.oss-cn-hangzhou.aliyuncs.com/mini_program/broker/recommend-article.png"
              alt=""
          /></span>
          <span class="article">文章</span>
          <span class="i"></span>
          <p>{{ content }}</p>
        </div>
      </div>
    </div>
    <Footer></Footer>
    <!-- <p><a @click="jump('/page/a')">跳转 a</a></p>
    <p><a @click="jump('/page/b')">跳转 b</a></p>-->
  </div>
</template>

<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import Footer from "@/components/Footer.vue";
@Component({
  components: {
    Footer
  }
})
export default class HomeIndex extends Vue {
  private content =
    "祥生云境祥生云境祥生云境祥生云境祥生云境祥生云境祥生云境祥生云境祥生云境";
  private menuInfo = [
    {
      size: 4,
      title: "热门楼盘"
    },
    {
      size: 3,
      title: "即将预售"
    },
    {
      size: 12,
      title: "正在公示"
    },
    {
      size: 9,
      title: "正在登记"
    },
    {
      size: 2,
      title: "最新摇号"
    }
  ];
  private menuBar = [
    {
      icon:
        "https://kpan.oss-cn-hangzhou.aliyuncs.com/upload/blnuZN1/1605271899794.png",
      title: "一键找房"
    },
    {
      icon:
        "https://kpan.oss-cn-hangzhou.aliyuncs.com/upload/blnuZN1/1605271924486.png",
      title: "限时抢卷"
    },
    {
      icon:
        "https://kpan.oss-cn-hangzhou.aliyuncs.com/upload/blnuZN1/1605271938819.png",
      title: "贷款计算"
    },
    {
      icon:
        "https://kpan.oss-cn-hangzhou.aliyuncs.com/upload/blnuZN1/1605271945152.png",
      title: "地图找房"
    },
    {
      icon:
        "https://kpan.oss-cn-hangzhou.aliyuncs.com/upload/blnuZN1/1605271959389.png",
      title: "积分商城"
    }
  ];
  jump(url: string) {
    window.open(url);
  }
}
</script>
<style lang="scss">
.main {
  margin-top: 20px;
  .search {
    margin: 0 auto;
    border-radius: 3px;
    width: 90%;
    height: 45px;
    background: white;
    box-shadow: 0px 0px 4px 4px rgb(230, 229, 229);
    display: flex;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
    margin-bottom: 30px;
    .arrow-down {
      width: 8px;
      height: 8px;
      margin-left: 5px;
    }
    .search-icon {
      width: 15px;
      height: 15px;
      vertical-align: text-top;
    }
    .line {
      vertical-align: text-top;
      margin: 0 10px;
      color: rgb(194, 194, 194);
    }
    input {
      outline: none;
      border: none;
      color: rgb(194, 194, 194);
    }
  }
  .menus {
    width: 95%;
    margin: 10px auto;
    display: flex;
    justify-content: space-between;
    box-sizing: border-box;
    padding: 10px;
    .menus-item {
      .box {
        margin: 0 auto;
        text-align: center;
        //border: 1px solid red;
        line-height: 40px;
        height: 40px;
        border-radius: 20px;
        background: linear-gradient(
          to right,
          rgb(243, 124, 55),
          rgb(235, 85, 36)
        );
        color: white;
        font-size: 14px;
      }
      &:nth-child(2) .box {
        background: linear-gradient(
          to right,
          rgb(102, 165, 247),
          rgb(72, 118, 179)
        );
      }
      &:nth-child(3) .box {
        background: linear-gradient(
          to right,
          rgb(83, 245, 177),
          rgb(72, 218, 157)
        );
      }
      &:nth-child(4) .box {
        background: rgb(235, 182, 10);
      }
      &:nth-child(5) .box {
        background: rgb(153, 163, 175);
      }

      .title {
        margin-top: 8px;
        font-size: 14px;
      }
      .icon {
        text-align: center;
        margin: 0 auto;
      }
      img {
        width: 32px;
        height: 32px;
      }
    }
  }
  .adv {
    width: 90%;
    height: 50px;
    //border: 1px solid red;
    margin: 20px auto;
    background: rgba(72, 134, 226, 0.1);
    display: flex;
    align-items: center;
    padding: 0px 10px;
    box-sizing: border-box;
    border-radius: 4px;
    .article-icon {
      width: 16px;
      height: 16px;
      vertical-align: text-top;
    }
    .article {
      font-weight: 700;
      font-size: 16px;
      margin: 0 10px;
      flex: none;
    }
    .i {
      width: 1px;
      height: 1px;
      border: 1px solid rgb(133, 133, 133);
      border-radius: 50%;
      background: rgb(133, 133, 133);
      margin-right: 10px;
    }
    p {
      font-size: 14px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }
}
</style>
